package com.bw.liuyushan.mykotlin_firstmvptest.MVP.Activity

import androidx.fragment.app.Fragment
import com.bw.liuyushan.mvp_kotlin_lib.View.BaseActivity
import com.bw.liuyushan.mykotlin_firstmvptest.Adapter.FragmentAdapter
import com.bw.liuyushan.mykotlin_firstmvptest.Adapter.FragmentAdapters
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Contrack.IContrackTest
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Fragment.BlankFragment
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Fragment.BlankFragment2
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Fragment.BlankFragment3
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Presenter.BasePresenterTest
import com.bw.liuyushan.mykotlin_firstmvptest.R
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : BaseActivity<BasePresenterTest>(),IContrackTest.C_ViewTest {
    lateinit var fragments: ArrayList<Fragment>
    lateinit var strings: ArrayList<String>


    override fun bindLayout(): Int {
        return R.layout.activity_main
    }

    override fun initView() {

        fragments = arrayListOf<Fragment>()
        fragments.add(BlankFragment())
        fragments.add(BlankFragment2())
        fragments.add(BlankFragment3())

        strings = arrayListOf<String>()
        strings.add("新闻")
        strings.add("热点")
        strings.add("推荐")

        val fragmentAdapters = FragmentAdapters(supportFragmentManager, this.fragments, this.strings)
        vp.adapter = fragmentAdapters
        tab.setupWithViewPager(vp)

    }

    override fun initDate() {
    }

}
